<template>
  <div class="box">
    <componentsChild :msg="text" @send-example="logMsg"></componentsChild>
  </div>
</template>


<script setup>

// 导入需要使用的组件
import componentsChild from './components/ComponentsChild.vue';
import { ref } from 'vue'

//因为components01接收的msg类型为String, 这里传的是number;
// 数据是可以传送到子组件,但是会报类型检查错误
const text = ref('goods')

const logMsg = (val) => {
  console.log('receive data:', val)
}

</script>

<style scoped>
.box {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}

.my-button {
  display: inline-block;
  text-align: center;
  vertical-align: middle;
  padding: 15px 32px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
}
</style>
